const fs = require('fs');

const content = 'This is a new message.\n';
const opt = {
    flag: 'a'
}

fs.writeFile('./data.txt', content, opt, (err) => {
    if (err) {
        console.error(err);
        return;
    }

    console.log('write success :-D');
})
